package com.xizi.剑指offer;

import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int count = 0;
        char[] chars = sc.next().toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'A') {
                count++;
            }
        }
        if (count == (n - count)) {
            System.out.println("T");
        } else {
            System.out.println(count > (n - count) ? 'A' : 'B');
        }

    }
}
